package com.kaifa.org.tp02.example06.controller;

import com.kaifa.org.tp02.example06.service.UserService;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

//将UserController转换成Spring中的Bean
@Controller
public class UserController {
    @Resource(name = "userService")
    private UserService userService;

    public void saveUser(){
        String loginName = "19931399942";
        String loginPwd = "11111111";

        userService.addUser(loginName,loginPwd);
        System.out.println("执行UserController中的saveUser方法");
    }
}
